<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>管理员登录</title>
    <link rel="stylesheet" href="../css/login.css">
    <script>
        // 表单提交事件处理程序
        document.addEventListener('DOMContentLoaded', function() {
            document.getElementById('loginForm').addEventListener('submit', function(event) {
                event.preventDefault(); // 阻止表单的默认提交行为
                
                // 获取用户名和密码输入值
                var username = document.getElementById('username').value;
                var password = document.getElementById('password').value;
                
                // 验证用户名和密码
                if (username === '123' && password === '123') {
                    // 如果用户名和密码正确，跳转到 welcome.html
                    window.location.href = 'welcome.html';
                } else {
                    // 如果用户名或密码错误，显示错误信息
                    alert('用户名或密码错误，请重新输入！');
                }
            });
        });
    </script>
</head>

<body>
    <div class="login-container">
        <h1>管理员登录</h1>
        <form id="loginForm" action="check_login.html" method="post">
            <label for="username">用户名:</label>
            <input type="text" id="username" name="username" required>
            
            <label for="password">密码:</label>
            <input type="password" id="password" name="password" required>
            
            <button type="submit">登录</button>
        </form>
    </div>
</body>
</html>